3.990 \(\int \sec (c+d x) (a+a \sin (c+d x))^3 (A+B \sin (c+d x)) \, dx\)

Optimal. Leaf size=81 \[ -\frac {a^3 (A+B) \sin ^2(c+d x)}{2 d}-\frac {3 a^3 (A+B) \sin (c+d x)}{d}-\frac {4 a^3 (A+B) \log (1-\sin (c+d x))}{d}-\frac {B (a \sin (c+d x)+a)^3}{3 d} \]

[Out]

-4*a^3*(A+B)*ln(1-sin(d*x+c))/d-3*a^3*(A+B)*sin(d*x+c)/d-1/2*a^3*(A+B)*sin(d*x+c)^2/d-1/3*B*(a+a*sin(d*x+c))^3
/d

________________________________________________________________________________________

Rubi [A]  time = 0.09, antiderivative size = 81, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.069, Rules used = {2836, 77} \[ -\frac {a^3 (A+B) \sin ^2(c+d x)}{2 d}-\frac {3 a^3 (A+B) \sin (c+d x)}{d}-\frac {4 a^3 (A+B) \log (1-\sin (c+d x))}{d}-\frac {B (a \sin (c+d x)+a)^3}{3 d} \]

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]*(a + a*Sin[c + d*x])^3*(A + B*Sin[c + d*x]),x]

[Out]

(-4*a^3*(A + B)*Log[1 - Sin[c + d*x]])/d - (3*a^3*(A + B)*Sin[c + d*x])/d - (a^3*(A + B)*Sin[c + d*x]^2)/(2*d)
 - (B*(a + a*Sin[c + d*x])^3)/(3*d)

Rule 77

Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))

Rule 2836

Int[cos[(e_.) + (f_.)*(x_)]^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)
*(x_)])^(n_.), x_Symbol] :> Dist[1/(b^p*f), Subst[Int[(a + x)^(m + (p - 1)/2)*(a - x)^((p - 1)/2)*(c + (d*x)/b
)^n, x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, c, d, m, n}, x] && IntegerQ[(p - 1)/2] && EqQ[a^2 - b^2,
 0]

Rubi steps

\begin {align*} \int \sec (c+d x) (a+a \sin (c+d x))^3 (A+B \sin (c+d x)) \, dx &=\frac {a \operatorname {Subst}\left (\int \frac {(a+x)^2 \left (A+\frac {B x}{a}\right )}{a-x} \, dx,x,a \sin (c+d x)\right )}{d}\\ &=\frac {a \operatorname {Subst}\left (\int \left (-3 a (A+B)+\frac {4 a^2 (A+B)}{a-x}-(A+B) x-\frac {B (a+x)^2}{a}\right ) \, dx,x,a \sin (c+d x)\right )}{d}\\ &=-\frac {4 a^3 (A+B) \log (1-\sin (c+d x))}{d}-\frac {3 a^3 (A+B) \sin (c+d x)}{d}-\frac {a^3 (A+B) \sin ^2(c+d x)}{2 d}-\frac {B (a+a \sin (c+d x))^3}{3 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.13, size = 68, normalized size = 0.84 \[ -\frac {a^3 \left (3 (A+3 B) \sin ^2(c+d x)+6 (3 A+4 B) \sin (c+d x)+24 (A+B) \log (1-\sin (c+d x))+2 B \sin ^3(c+d x)\right )}{6 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[c + d*x]*(a + a*Sin[c + d*x])^3*(A + B*Sin[c + d*x]),x]

[Out]

-1/6*(a^3*(24*(A + B)*Log[1 - Sin[c + d*x]] + 6*(3*A + 4*B)*Sin[c + d*x] + 3*(A + 3*B)*Sin[c + d*x]^2 + 2*B*Si
n[c + d*x]^3))/d

________________________________________________________________________________________

fricas [A]  time = 0.69, size = 77, normalized size = 0.95 \[ \frac {3 \, {\left (A + 3 \, B\right )} a^{3} \cos \left (d x + c\right )^{2} - 24 \, {\left (A + B\right )} a^{3} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (B a^{3} \cos \left (d x + c\right )^{2} - {\left (9 \, A + 13 \, B\right )} a^{3}\right )} \sin \left (d x + c\right )}{6 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(a+a*sin(d*x+c))^3*(A+B*sin(d*x+c)),x, algorithm="fricas")

[Out]

1/6*(3*(A + 3*B)*a^3*cos(d*x + c)^2 - 24*(A + B)*a^3*log(-sin(d*x + c) + 1) + 2*(B*a^3*cos(d*x + c)^2 - (9*A +
 13*B)*a^3)*sin(d*x + c))/d

________________________________________________________________________________________

giac [B]  time = 0.21, size = 289, normalized size = 3.57 \[ \frac {2 \, {\left (6 \, {\left (A a^{3} + B a^{3}\right )} \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right ) - 12 \, {\left (A a^{3} + B a^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {11 \, A a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} + 11 \, B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} + 9 \, A a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 12 \, B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 36 \, A a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 42 \, B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 18 \, A a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 28 \, B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 36 \, A a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 42 \, B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 9 \, A a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 12 \, B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 11 \, A a^{3} + 11 \, B a^{3}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{3}}\right )}}{3 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(a+a*sin(d*x+c))^3*(A+B*sin(d*x+c)),x, algorithm="giac")

[Out]

2/3*(6*(A*a^3 + B*a^3)*log(tan(1/2*d*x + 1/2*c)^2 + 1) - 12*(A*a^3 + B*a^3)*log(abs(tan(1/2*d*x + 1/2*c) - 1))
 - (11*A*a^3*tan(1/2*d*x + 1/2*c)^6 + 11*B*a^3*tan(1/2*d*x + 1/2*c)^6 + 9*A*a^3*tan(1/2*d*x + 1/2*c)^5 + 12*B*
a^3*tan(1/2*d*x + 1/2*c)^5 + 36*A*a^3*tan(1/2*d*x + 1/2*c)^4 + 42*B*a^3*tan(1/2*d*x + 1/2*c)^4 + 18*A*a^3*tan(
1/2*d*x + 1/2*c)^3 + 28*B*a^3*tan(1/2*d*x + 1/2*c)^3 + 36*A*a^3*tan(1/2*d*x + 1/2*c)^2 + 42*B*a^3*tan(1/2*d*x
+ 1/2*c)^2 + 9*A*a^3*tan(1/2*d*x + 1/2*c) + 12*B*a^3*tan(1/2*d*x + 1/2*c) + 11*A*a^3 + 11*B*a^3)/(tan(1/2*d*x
+ 1/2*c)^2 + 1)^3)/d

________________________________________________________________________________________

maple [B]  time = 0.36, size = 161, normalized size = 1.99 \[ -\frac {a^{3} A \left (\sin ^{2}\left (d x +c \right )\right )}{2 d}-\frac {4 a^{3} A \ln \left (\cos \left (d x +c \right )\right )}{d}-\frac {B \,a^{3} \left (\sin ^{3}\left (d x +c \right )\right )}{3 d}-\frac {4 a^{3} B \sin \left (d x +c \right )}{d}+\frac {4 B \,a^{3} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}-\frac {3 a^{3} A \sin \left (d x +c \right )}{d}+\frac {4 a^{3} A \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}-\frac {3 B \,a^{3} \left (\sin ^{2}\left (d x +c \right )\right )}{2 d}-\frac {4 B \,a^{3} \ln \left (\cos \left (d x +c \right )\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)*(a+a*sin(d*x+c))^3*(A+B*sin(d*x+c)),x)

[Out]

-1/2/d*a^3*A*sin(d*x+c)^2-4/d*a^3*A*ln(cos(d*x+c))-1/3/d*B*a^3*sin(d*x+c)^3-4*a^3*B*sin(d*x+c)/d+4/d*B*a^3*ln(
sec(d*x+c)+tan(d*x+c))-3/d*a^3*A*sin(d*x+c)+4/d*a^3*A*ln(sec(d*x+c)+tan(d*x+c))-3/2/d*B*a^3*sin(d*x+c)^2-4/d*B
*a^3*ln(cos(d*x+c))

________________________________________________________________________________________

maxima [A]  time = 0.35, size = 73, normalized size = 0.90 \[ -\frac {2 \, B a^{3} \sin \left (d x + c\right )^{3} + 3 \, {\left (A + 3 \, B\right )} a^{3} \sin \left (d x + c\right )^{2} + 24 \, {\left (A + B\right )} a^{3} \log \left (\sin \left (d x + c\right ) - 1\right ) + 6 \, {\left (3 \, A + 4 \, B\right )} a^{3} \sin \left (d x + c\right )}{6 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(a+a*sin(d*x+c))^3*(A+B*sin(d*x+c)),x, algorithm="maxima")

[Out]

-1/6*(2*B*a^3*sin(d*x + c)^3 + 3*(A + 3*B)*a^3*sin(d*x + c)^2 + 24*(A + B)*a^3*log(sin(d*x + c) - 1) + 6*(3*A
+ 4*B)*a^3*sin(d*x + c))/d

________________________________________________________________________________________

mupad [B]  time = 0.09, size = 100, normalized size = 1.23 \[ -\frac {{\sin \left (c+d\,x\right )}^2\,\left (\frac {a^3\,\left (A+2\,B\right )}{2}+\frac {B\,a^3}{2}\right )+\sin \left (c+d\,x\right )\,\left (a^3\,\left (A+2\,B\right )+a^3\,\left (2\,A+B\right )+B\,a^3\right )+\ln \left (\sin \left (c+d\,x\right )-1\right )\,\left (4\,A\,a^3+4\,B\,a^3\right )+\frac {B\,a^3\,{\sin \left (c+d\,x\right )}^3}{3}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((A + B*sin(c + d*x))*(a + a*sin(c + d*x))^3)/cos(c + d*x),x)

[Out]

-(sin(c + d*x)^2*((a^3*(A + 2*B))/2 + (B*a^3)/2) + sin(c + d*x)*(a^3*(A + 2*B) + a^3*(2*A + B) + B*a^3) + log(
sin(c + d*x) - 1)*(4*A*a^3 + 4*B*a^3) + (B*a^3*sin(c + d*x)^3)/3)/d

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ a^{3} \left (\int A \sec {\left (c + d x \right )}\, dx + \int 3 A \sin {\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int 3 A \sin ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int A \sin ^{3}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int B \sin {\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int 3 B \sin ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int 3 B \sin ^{3}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int B \sin ^{4}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(a+a*sin(d*x+c))**3*(A+B*sin(d*x+c)),x)

[Out]

a**3*(Integral(A*sec(c + d*x), x) + Integral(3*A*sin(c + d*x)*sec(c + d*x), x) + Integral(3*A*sin(c + d*x)**2*
sec(c + d*x), x) + Integral(A*sin(c + d*x)**3*sec(c + d*x), x) + Integral(B*sin(c + d*x)*sec(c + d*x), x) + In
tegral(3*B*sin(c + d*x)**2*sec(c + d*x), x) + Integral(3*B*sin(c + d*x)**3*sec(c + d*x), x) + Integral(B*sin(c
 + d*x)**4*sec(c + d*x), x))

________________________________________________________________________________________